// JavaScript Document
rajyasabha = jQuery.noConflict();
 rajyasabha().ready(function() {
					
                    rajyasabha("#rajyasabha-node-form").validate({
						
						rules:{
							'field_mp_post[und]':{
								  required:true,
								  valuenotequals:'_none',
							  },
							'title':{
								required:true,
								badchar:true,
								minlength:5,
								//lettersonly:true,
							},
							'field_mp_designation[und][0][value]':{
							  badchar:true,
							},
							'field_mp_partyname[und]':{
							required:true,
							valuenotequals: '_none',
							},
							'files[field_mp_image_und_0]':{
							required:true,
							//checkfile_format_size: true,
							},
							'field_mp_start[und][0][value][date]':{
							required:true,
							dateformat:true,
							date_notgreater_tdy:true,
							},
							'field_mp_end[und][0][value][date]':{
							required:true,
							dateformat:true,
							date_notless_tdy:true,
							//date_less_than:true,
							},
							'field_mp_addlocal[und][0][value]':{
								 badchar:true,
							},
							'field_mp_adddelhi[und][0][value]':{
							 badchar:true,
							},
							'field_mp_code[und][0][value]':{
							digits:true,
							minlength:3,
							maxlength:5,
							},
							'field_mp_phone[und][0][value]':{
							minlength:6,
							maxlength:8,
							digits:true,
							},
							'field_mp_dcode[und][0][value]':{
							digits:true,
							minlength:3,
							maxlength:5,
							},
							'field_mp_delhiphone[und][0][value]':{
							minlength:6,
							maxlength:8,
							digits:true,
							},
							'field_mp_fax[und][0][value]':{
							digits:true,
							},
							'field_mp_email[und][0][value]':{
							email:true,
							},
							'field_mp_url[und][0][value]':{
							url:true,
							},
						},
						messages:{
							'field_mp_post[und]':{
								required:' Please Choose the Position ',
								valuenotequals: 'Please Choose the Position',
							},
							'title':{
								required:'Please Enter the Name',
								badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed',
								//lettersonly:'Only alphabets should be entered',
								minlength:'Minimum 5 character only allowed',

							},
							'field_mp_designation[und][0][value]':{
							  badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed',	
							},
							'field_mp_partyname[und]':{
							required:'Please Choose the Party Name',
							valuenotequals: ' Please Choose the Party Name',
							},
							'files[field_mp_image_und_0]':{
							required:'Please Choose a photo',
							//checkfile_format_size: 'Please check the file format',
							},
							'field_mp_start[und][0][value][date]':{
							required:'Please Enter the start date',
							dateformat:'Please Check the date format',
							date_notgreater_tdy:'Date should not be greater than current date',
							},
							'field_mp_end[und][0][value][date]':{
							required:'Please Enter the End date',
							dateformat:'Please Check the date format',
							//date_less_than:'Date should not be greater than start date',
							date_notless_tdy:'Date should not be lesser than from date',
							},
							'field_mp_addlocal[und][0][value]':{
								 badchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							},
							'field_mp_adddelhi[und][0][value]':{
							 badchar:true,
							},
							'field_mp_code[und][0][value]':{
							digits:'Only digits are allowed',
							minlength:'Minimum 3 characters should be entered',
							maxlength:'Maximum 5 character only allowed',
							},
							'field_mp_phone[und][0][value]':{
							digits:'Only digits are allowed',
							minlength:'Minimum 6 characters should be entered',
							maxlength:'Maximum 8 character only allowed',
							},
							'field_mp_dcode[und][0][value]':{
							digits:'Only digits are allowed',
							minlength:'Minimum 3 characters should be entered',
							maxlength:'Maximum 5 character only allowed',
							},
							'field_mp_delhiphone[und][0][value]':{
							digits:'Only digits are allowed',
							minlength:'Minimum 6 characters should be entered',
							maxlength:'Maximum 8 character only allowed',
							},
							'field_mp_fax[und][0][value]':{
							digits:'Only digits are allowed',
							},
							'field_mp_email[und][0][value]':{
							email:'Invalid e-mail id',
							},
							'field_mp_url[und][0][value]':{
							url:'Invalid URL',
							},
						},
						invalidHandler: function(form, validator) {
       
       					 if (!validator.numberOfInvalids())
								return;
						else{
							
							  //documents("#documents-node-form").create_errormsg_container('errormsg_container','documents-node-form');
						}
							
							rajyasabha('html, body').animate({
								scrollTop: rajyasabha(validator.errorList[0].element).offset().top - 100
							}, 1000);
							
						},
				

   
	});




            
});


							